Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed httpd logger to get user from query params #3304

Merged
merged 1 commit into from
Jul 13, 2015

Conversation

jhorwit2
Copy link
Contributor

Before

[http] 2015/07/12 19:41:17 ::1 - - [12/Jul/2015:19:41:17 -0400] GET /query?u=root&p=root&db=test HTTP/1.1 400 68 - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36 7dc2edc3-28ef-11e5-8001-000000000000 1.033983ms

After

[http] 2015/07/12 19:40:49 ::1 - root [12/Jul/2015:19:40:49 -0400] GET /query?u=root&p=root&db=test HTTP/1.1 400 68 - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36 6cf04b18-28ef-11e5-8005-000000000000 1.075422ms

@otoolep
Copy link
Contributor

otoolep commented Jul 13, 2015

To be clear, this change adds root to the log message?

@jhorwit2
Copy link
Contributor Author

This fixes logging the user who requested the query. It was not correctly logging the user when you did query param auth. You can see my u value in those requests were root, but they could be any user.

@jhorwit2
Copy link
Contributor Author

The logging checks for other types of auth. User in url (not sure what that is) and the basic auth header as defined by the RFC.

@otoolep
Copy link
Contributor

otoolep commented Jul 13, 2015

OK, thanks @jhorwit2 , I see what you are doing, makes sense to me. You will need to rebase this code before we can merge it.

@corylanou ?

@corylanou
Copy link
Contributor

I think the original reason it wasn't in the logger as parameters aren't usually considered to have "user" information in them. I don't see the harm in this, as I don't think any of our other endpoints use the u parameter, so it won't get confused with other potential data values.

+1

@jhorwit2
Copy link
Contributor Author

@otoolep rebased 👍

otoolep added a commit that referenced this pull request Jul 13, 2015
Fixed httpd logger to get user from query params
@otoolep otoolep merged commit 836621e into influxdata:master Jul 13, 2015
@jhorwit2 jhorwit2 deleted the jah/logger-fix branch July 13, 2015 23:26
adrian-thurston added a commit that referenced this pull request Nov 5, 2020
A static initialization is not desirable in the main binaries, as it forces all
paths of code to init, but it is still useful in tests. It allows static
intialization to be performed once for all tests and eliminates the need to
always add the FluxInit call. Added a fluxinit/static package that calls
fluxinit.FluxInit() to replace the builtin package. This hides the nature of
the initialization and makes it clear that it is mandatory initialization code
getting called.
adrian-thurston added a commit that referenced this pull request Nov 5, 2020
A static initialization is not desirable in the main binaries, as it forces all
paths of code to init, but it is still useful in tests. It allows static
intialization to be performed once for all tests and eliminates the need to
always add the FluxInit call. Added a fluxinit/static package that calls
fluxinit.FluxInit() to replace the builtin package. This hides the nature of
the initialization and makes it clear that it is mandatory initialization code
getting called.
adrian-thurston added a commit that referenced this pull request Nov 6, 2020
A static initialization is not desirable in the main binaries, as it forces all
paths of code to init, but it is still useful in tests. It allows static
intialization to be performed once for all tests and eliminates the need to
always add the FluxInit call. Added a fluxinit/static package that calls
fluxinit.FluxInit() to replace the builtin package. This hides the nature of
the initialization and makes it clear that it is mandatory initialization code
getting called.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants